-module(tr_sup).
-behaviour(supervisor).
-export([init/1]).
-export([start_link/0]).
-define(SERVER,?MODULE).
start_link() ->
	supervisor:start_link({local,?SERVER},?MODULE,[]).
init([]) ->
	Children = [
		{l2_parser,{l2_packet_fun,start_link,[]},permanent,2000,worker,[l2_packet_fun,parser_eng]},
		{ip_parser,{gen_server,start_link,[{local,ip_parser},ip_parser,[],[]]},permanent,2000,worker,[ip_parser]},
		{udp_parser,{udp_packet_fun,start_link,[]},permanent,2000,worker,[udp_packet_fun,parser_eng]},
		{gtp_sup,{gtp_sup,start_link,[]},permanent,2000,supervisor,[gtp_sup]},
		{wlan_sup,{wlan_sup,start_link,[]},permanent,2000,supervisor,[wlan_sup]},
		{sub_server_sup,{sub_server_sup,start_link,[]},permanent,2000,supervisor,[sub_server_sup]},
    {s1ap_dispatcher,{s1ap_dispatcher,start_link,[]},permanent,2000,supervisor,[s1ap_dispatcher]},
		{sctp_pair_dispatcher,{sctp_pair_dispatcher,start_link,[]},permanent,2000,worker,[sctp_pair_dispatcher]},
		{sctp_pair_server_sup,{sctp_pair_server_sup,start_link,[]},permanent,2000,supervisor,[sctp_pair_server_sup]}, %%refer to sctp handle flow
		{unknown_packet_evt,{unknown_packet_evt,start_link,[]},permanent,2000,worker,[unknown_packet_evt]}, %%handle the packet I don't know how to handle
		{sys_mon_evt,{sys_mon_evt,start_link,[]},permanent,2000,worker,[sys_mon_evt]}, %%handle system event
		{push_server,{push_server,start_link,[]},permanent,2000,worker,[push_server]}, %%push data to specific session
    {net_elem_dis,{svr_dist,start_link,[net_elem_dis,signalpoint_sup]},permanent,2000,worker,[svr_dist,signalpiont,signalpoint_sup]},
    {cell_elem_dis,{svr_dist,start_link,[cell_elem_dis,signalpoint_sup]},permanent,2000,worker,[svr_dist,signalpiont,celleutran_sup]},
    {signalpoint_sup,{signalpoint_sup,start_link,[]},permanent,2000,worker,[signalpoint_sup,signalpoint]},
		{web_sup,{web_sup,start_link,[]},permanent,2000,worker,[web_sup]} %%manage the session to web client. websocket is used.

		],
	RestartStrategy = {one_for_one,0,1},
	{ok,{RestartStrategy,Children}}.
